<?php
/**
 * True Gallery Page Navigator template file
 *
 * @version 2.5
 * @author Alexey N. Brin (userxp@joomlaportal.ru)
 * @homepage http://truegallery.ru 
 * @filename pagenav.tpl.php
 * @package True Gallery
 * @copyright (C) 2008-2009 by joomlatune.ru
 * @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
 * 
 * THIS GALLERY is an EVOLUTION of AkoGallery -> PonyGallery -> DatsoGallery
 *
 * If you fork this to create your own project, 
 * please make a reference to True Gallery someplace in your code 
 * and provide a link to http://www.joomlatune.ru
 *
 **/

defined('_VALID_MOS') or defined('_JEXEC') or die('Direct Access to this location is not allowed.');

appendStyle( 'button2' );

?>
<div style="clear:both;"></div>
<div class=pagination>
<?php 
if( $row->first || $row->prev || $row->next && $row->last ) {
	if($row->first) { 
		Button2( JText::_('TG_FIRST'), 'abutton', 'start', $row->first, 'right', false );
	} else { 
		Button2( JText::_('TG_FIRST'), 'abutton', 'start', $row->first, 'right off', true );
	}
	
	if($row->prev) {
		Button2( JText::_('TG_PREV'), 'abutton', 'prev', $row->prev, 'right', false );
	} else {
		Button2( JText::_('TG_PREV'), 'abutton', 'prev', $row->prev, 'right off', true );
	} ?>
	
	<div class="button2-left">
		<div class="page">
		<?php foreach( $row->navs as $key=>$link ) { ?>
			<?php if( $key==$row->index ) { ?>
				<span><?php echo $key; ?></span>
			<?php } else { ?>
				<a href="<?php echo $link; ?>"><?php echo $key; ?></a>
			<?php } ?>
		<?php } ?>
		</div>
	</div>
	
	<?php 
	if($row->next) {
		Button2( JText::_('TG_NEXT'), 'abutton', 'next', $row->next, 'left', false );
	} else {
		Button2( JText::_('TG_PREV'), 'abutton', 'next', $row->next, 'left off', true );
	}
	
	if($row->last) {
		Button2( JText::_('TG_LAST'), 'abutton', 'end', $row->last, 'left', false );
	} else {
		Button2( JText::_('TG_LAST'), 'abutton', 'end', $row->last, 'left off', true );
	}
	?>
	<div class="true_nav_count"><span><?php echo $this->writePagesCounter(); ?></span></div>
<?php } ?>
</div>
<div style="clear:both;"></div>
